import json
f = open(r'D:\c.json','w',encoding='utf8')
d = {'name':'留校的','age':'30','x':'dfsafas'}
json.dump(d,f,ensure_ascii=False)
f.close()

f1 = open(r'D:\c.json','r',encoding='utf8')
d2 = json.load(f1)
for i,j in d2.items():
    if j == '30':
        d2[i] = '36'
f1.close()

f3 = open(r'D:\c.json','w',encoding='utf8')
json.dump(d2,f3,ensure_ascii=False)
f3.close()